package com.example.main.viewmodel

import androidx.lifecycle.MutableLiveData
import com.example.lib_base.entity.AnnouncementBean
import com.example.lib_base.mvvm.BaseViewModel
import com.example.main.Repo.PublicRepo
import com.example.main.net.APiSeevice
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class PublicViewModel @Inject constructor(private val repo:PublicRepo): BaseViewModel(){
    val noticeSuccess= MutableLiveData<AnnouncementBean>()
    val noticeError = MutableLiveData<String>()

    fun getNotice(page:Int,size:Int){
        httpRequest({repo.apiService.getAnnouncements(page, size)},{noticeSuccess.postValue(it)})
    }

}